Hi David, Could you be more specific what your problem is? Maybe: http://www.cnczone.com/forums/dynomotion_kflop_kanalog/157938-kflop_snapamps.html or http://www.cnczone.com/forums/dynomotion_kflop_kanalog/142000-optimizing_servo_tuning.html Regards TK
Group: DynoMotion |
Message: 5985 |
From: daveymahomh600e |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Hi Tom,
My main problem is I don't understand most of the elctronic jargon. PWMs, PID, etc. For example, when you helped me with the encoder problem last weekend, I would never have figured out that the encoder had to be set to channel 8. I think the PWM has to be similarly set, but I can't be sure how to do that properly and that gives me a real fear of damaging some sensitive electronic components.
I ran the AutoPhaseFind and recorded the values, but I really don't know where to go next. I entered them the way I thought they should be on the screens, but when I tried a simple move, the servo moved what I presume was the required amount, but then sat there clicking until I disabled the axis. When I ran AutoPhaseFind again, the values were different. So I ran it a third time and so on and got different values each time. In one case the counts per rev are 100000, 30000 for another, and anything in between for the other tests.
I went over the connections to be sure there were no shorts or loose wires, but everything seems correct.
The step by step was written by a fellow that complained the standard documentation was too complex for a non-electrical engineer to follow. I think the last couple of posts he was doubting his ability to finish the help guide because he had overlooked something and was feeling quite dejected about it. You rightfully encouraged him to keep on with it.
I have had a servo connected for three days, but can't figure out what to do next. I know the plots tell the tale, but I can't for the life of me interpret what they are showing. I am reading the KFlopManual.pdf again, but just getting more flustered.
Thanks,
David.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> Could you be more specific what your problem is?
>
> Maybe:
>
> http://www.cnczone.com/forums/dynomotion_kflop_kanalog/157938-kflop_snapamps.html
>
> or
>
> http://www.cnczone.com/forums/dynomotion_kflop_kanalog/142000-optimizing_servo_tuning.html
>
> Regards
> TK
>
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 8, 2012 10:39 AM
> Subject: [DynoMotion] Step by Step
>
>
> Â
> Hello Tom,
>
> A few weeks back I was reading a series of step by step instructions a fellow put together with the intention of helping people like me that are not really strong when it come to electrical problems. I thought it was on CNC Zone but I can't find it. Did you post a link for this somewhere?
>
> I am trying to get my 2 axis SnapAmp system running and most of the tuning stuff is bouncing right off of my brain. I thought that if I read through that posting it would help.
>
> If you know what I am referring to, could you please post a link?
>
> Thanks,
> David.
>
|
|
Group: DynoMotion |
Message: 5988 |
From: daveymahomh600e |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Group: DynoMotion |
Message: 5989 |
From: Tom Kerekes |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Hi David,
The first requirement is to get the AutoPhaseFind.c test to work reliable. The test is pretty simple. It moves the 3-phase brushless motor in a simple manner much like a stepper motor by energizing the coils in sequence. It then watches the encoder position and the index pulse. After it sees several index pulses it reverses the motor rotation direction. So 3 things must work correctly. The motor must rotate, the encoder must count properly, and the
index pulse must work. You should test the encoder first. Move the motor/encoder by hand and observe the Position on the Axis Screen. The position should track the motor/encoder position such that when returning back to the same place the count should be the same.
Regards TK
Group: DynoMotion |
Message: 5990 |
From: daveymahomh600e |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Hi Tom,
When I turn the encoder by hand, the position readout changes as I would expect. I could also see the AB boxes changing on the digital IO screen, but I didn't see the index pulse show up.
David
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> The first requirement is to get the AutoPhaseFind.c test to work reliable. The test is pretty simple. It moves the 3-phase brushless motor in a simple manner much like a stepper motor by energizing the coils in sequence. It then watches the encoder position and the index pulse. After it sees several index pulses it reverses the motor rotation direction. So 3 things must work correctly. The motor must rotate, the encoder must count properly, and the index pulse must work. You should test the encoder first. Move the motor/encoder by hand and observe the Position on the Axis Screen. The position should track the motor/encoder position such that when returning back to the same place the count should be the same.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 8, 2012 12:03 PM
> Subject: [DynoMotion] Re: Step by Step
>
>
> Â
> Hi Tom,
>
> My main problem is I don't understand most of the elctronic jargon. PWMs, PID, etc. For example, when you helped me with the encoder problem last weekend, I would never have figured out that the encoder had to be set to channel 8. I think the PWM has to be similarly set, but I can't be sure how to do that properly and that gives me a real fear of damaging some sensitive electronic components.
>
> I ran the AutoPhaseFind and recorded the values, but I really don't know where to go next. I entered them the way I thought they should be on the screens, but when I tried a simple move, the servo moved what I presume was the required amount, but then sat there clicking until I disabled the axis. When I ran AutoPhaseFind again, the values were different. So I ran it a third time and so on and got different values each time. In one case the counts per rev are 100000, 30000 for another, and anything in between for the other tests.
>
> I went over the connections to be sure there were no shorts or loose wires, but everything seems correct.
>
> The step by step was written by a fellow that complained the standard documentation was too complex for a non-electrical engineer to follow. I think the last couple of posts he was doubting his ability to finish the help guide because he had overlooked something and was feeling quite dejected about it. You rightfully encouraged him to keep on with it.
>
> I have had a servo connected for three days, but can't figure out what to do next. I know the plots tell the tale, but I can't for the life of me interpret what they are showing. I am reading the KFlopManual.pdf again, but just getting more flustered.
>
> Thanks,
> David.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi David,
> >
> > Could you be more specific what your problem is?
> >
> > Maybe:
> >
> > http://www.cnczone.com/forums/dynomotion_kflop_kanalog/157938-kflop_snapamps.html
> >
> > or
> >
> > http://www.cnczone.com/forums/dynomotion_kflop_kanalog/142000-optimizing_servo_tuning.html
> >
> > Regards
> > TK
> >
> >
> >
> >
> >
> > ________________________________
> > From: daveymahomh600e <david.m.stevenson@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 8, 2012 10:39 AM
> > Subject: [DynoMotion] Step by Step
> >
> >
> > ÃÂ
> > Hello Tom,
> >
> > A few weeks back I was reading a series of step by step instructions a fellow put together with the intention of helping people like me that are not really strong when it come to electrical problems. I thought it was on CNC Zone but I can't find it. Did you post a link for this somewhere?
> >
> > I am trying to get my 2 axis SnapAmp system running and most of the tuning stuff is bouncing right off of my brain. I thought that if I read through that posting it would help.
> >
> > If you know what I am referring to, could you please post a link?
> >
> > Thanks,
> > David.
> >
>
|
|
Group: DynoMotion |
Message: 5991 |
From: Tom Kerekes |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Hi David,
The index pulse is very narrow. You will have to position and hold the encoder to an exact position to see it change which is almost impossible to do by hand. User programs execute every 180us so as long as the pulse is wider than this it will be detected properly. If the index is never detected the program should rotate forever looking for the index.
Why don't you post some AutoPhaseFind.c reports so we can look at them? As well as a detailed description of what you observe.
Regards TK
Group: DynoMotion |
Message: 5992 |
From: David Stevenson |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Hi
Tom,
Here are 4
reports, which look a lot better than most have...
After each
report I noted how many turns (revs) the shaft made... so many in one direction
and then so many in the opposite direction. I didn't catch the number for the
first set on the first test. I know the encoder is a 2500 ppr, so I expect 10000
for a full turn of the shaft.
REPORT ------ 0 Position = 0
PhaseAngle = 0.416000 1 Position = 10000 PhaseAngle = 2.455000 2
Position = 1 PhaseAngle = 0.197000 3 Position =
-109999 PhaseAngle = -21.803000 Counts per rev = 10000 Counts per
cycle = 4904 Counts per cycle (rounded)=
4900 invDistPerCycle (rounded)= 0.000204081633 Commutation offset
= 2822 Input Gain Specified = 1.000
? and 10
turns
REPORT ------ 0 Position = -1
PhaseAngle = 0.417000 1 Position = 119999 PhaseAngle = 24.455000 2
Position = 39998 PhaseAngle = 8.196000 3 Position = 19998
PhaseAngle = 4.196000 Counts per rev = 120000 Counts per cycle
= 4992 Counts per cycle (rounded)=
4990 invDistPerCycle (rounded)= 0.000200400802 Commutation offset
= 2872 Input Gain Specified = 1.000
12 and 10
turns
REPORT ------ 0 Position = 2
PhaseAngle = 0.417000 1 Position = 60001 PhaseAngle = 12.454000 2
Position = 50001 PhaseAngle = 10.198000 3 Position = 30002
PhaseAngle = 6.198000 Counts per rev = 59999 Counts per cycle
= 4985 Counts per cycle (rounded)=
4980 invDistPerCycle (rounded)= 0.000200803213 Commutation offset
= 2868 Input Gain Specified = 1.000
6 and 10
turns
REPORT ------ 0 Position = 0
PhaseAngle = 0.417000 1 Position = 39999 PhaseAngle = 8.454000 2
Position = -40001 PhaseAngle = -7.802000 3 Position = -60002 PhaseAngle =
-11.802000 Counts per rev = 39999 Counts per cycle =
4977 Counts per cycle (rounded)= 4980 invDistPerCycle
(rounded)= 0.000200803213 Commutation offset =
2868 Input Gain Specified = 1.000
4 and 10
turns
Here are
the settings I used for the APF.c program...
#define
PWM_CHAN 8 // which pair of PWM channels used #define
ENCODER_CHAN 8 // which encoder we are connected to #define
ENCODER_GAIN 1 // Set to -1 if desired to reverse axis
direction #define AMPLITUDE 10 // Set how hard to
drive the coils pwm counts #define Z_BIT_NUMBER 66 // What bit the
Z index is connected to #define CLAMP_VOLTAGE 85 // volts - set a
few volts higher than your supply #define
AXIS_CHAN 0 // Axis channel
to be used and configured #define Ncycles 4 // don't change
this
Thank
you,
David.
Hi David,
The
index pulse is very narrow. You will have to position and hold the
encoder to an exact position to see it change which is almost impossible to do
by hand. User programs execute every 180us so as long as the pulse is
wider than this it will be detected properly. If the index is never
detected the program should rotate forever looking for the index.
Why
don't you post some AutoPhaseFind.c reports so we can look at them? As
well as a detailed description of what you observe.
Regards
TK
Group: DynoMotion |
Message: 5993 |
From: Tom Kerekes |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Hi David,
It looks like the Index is not being detected every time. Because the Counts/Rev are always exactly a multiple of 10,000 it appears the encoder and index are working perfectly when it is detected. It just isn't detected every time.
You might check the wire and voltages. If one of the + or - signals is not connected the signal can be erratic. Normally the index is not present so the + signal will be high (>3V) and the - signal low (< 0.4V). So you might check those voltages with a volt meter.
It might be that the pulse is so short that the software loop misses it. Your encoder is fairly high resolution so the index pulse might be very small.
Now that I look at the AutoPhaseFind.c program I see that is actually only checking for the index every millisecond. I've attached a modified program that checks every time slice (180us) which is 5X faster. I've also slowed down the rotation speed about 2X. Please try that.
Regards TK
Group: DynoMotion |
Message: 5994 |
From: daveymahomh600e |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Hi Tom,
The new program seems to have cured that issue. Here are 3 reports...
REPORT
------
0 Position = 1 PhaseAngle = 0.390600
1 Position = 10001 PhaseAngle = 2.396800
2 Position = 10002 PhaseAngle = 2.299000
3 Position = 2 PhaseAngle = 0.255400
Counts per rev = 10000
Counts per cycle = 4985
Counts per cycle (rounded)= 4980
invDistPerCycle (rounded)= 0.000200803213
Commutation offset = 2978
Input Gain Specified = 1.000
REPORT
------
0 Position = -1 PhaseAngle = 0.390400
1 Position = 9999 PhaseAngle = 2.397600
2 Position = 10000 PhaseAngle = 2.298800
3 Position = 0 PhaseAngle = 0.255000
Counts per rev = 10000
Counts per cycle = 4982
Counts per cycle (rounded)= 4980
invDistPerCycle (rounded)= 0.000200803213
Commutation offset = 2979
Input Gain Specified = 1.000
REPORT
------
0 Position = -1 PhaseAngle = 0.390500
1 Position = 9999 PhaseAngle = 2.397300
2 Position = 10000 PhaseAngle = 2.298900
3 Position = 0 PhaseAngle = 0.255100
Counts per rev = 10000
Counts per cycle = 4983
Counts per cycle (rounded)= 4980
invDistPerCycle (rounded)= 0.000200803213
Commutation offset = 2979
Input Gain Specified = 1.000
In each case, the motor shaft rotated once in each direction.
Sooo, the next step is....
Thank you very much,
David.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
>
>
> Hi David,
>
> It looks like the Index is not being detected every time. Because the Counts/Rev are always exactly a multiple of 10,000 it appears the encoder and index are working perfectly when it is detected. It just isn't detected every time.
>
> You might check the wire and voltages. If one of the + or - signals is not connected the signal can be erratic. Normally the index is not present so the + signal will be high (>3V) and the - signal low (< 0.4V). So you might check those voltages with a volt meter.
>
> It might be that the pulse is so short that the software loop misses it. Your encoder is fairly high resolution so the index pulse might be very small.Â
>
>
> Now that I look at the AutoPhaseFind.c program I see that is actually only checking for the index every millisecond. I've attached a modified program that checks every time slice (180us) which is 5X faster. I've also slowed down the rotation speed about 2X. Please try that.
>
> Regards
> TK
>
>
>
> ________________________________
> From: David Stevenson <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 8, 2012 4:24 PM
> Subject: RE: [DynoMotion] Re: Step by Step
>
>
> Â
> 
> Hi
> Tom,
> Â
> Here are 4
> reports, which look a lot better than most have...
> Â
> After each
> report I noted how many turns (revs) the shaft made... so many in one direction
> and then so many in the opposite direction. I didn't catch the number for the
> first set on the first test. I know the encoder is a 2500 ppr, so I expect 10000
> for a full turn of the shaft.
> Â
> REPORT
> ------
> 0 Position =Â Â Â Â Â 0
> PhaseAngle = 0.416000
> 1 Position =Â 10000 PhaseAngle = 2.455000
> 2
> Position =Â Â Â Â Â 1 PhaseAngle = 0.197000
> 3 Position =
> -109999 PhaseAngle = -21.803000
> Counts per rev =Â 10000
> Counts per
> cycle =Â Â 4904
> Counts per cycle (rounded)=Â Â
> 4900
> invDistPerCycle (rounded)=Â 0.000204081633
> Commutation offset
> =Â Â 2822
> Input Gain Specified =Â 1.000
> Â
> ? and 10
> turns
> Â
> REPORT
> ------
> 0 Position =Â Â Â Â -1
> PhaseAngle = 0.417000
> 1 Position = 119999 PhaseAngle = 24.455000
> 2
> Position =Â 39998 PhaseAngle = 8.196000
> 3 Position =Â 19998
> PhaseAngle = 4.196000
> Counts per rev = 120000
> Counts per cycle
> =Â Â 4992
> Counts per cycle (rounded)=Â Â
> 4990
> invDistPerCycle (rounded)=Â 0.000200400802
> Commutation offset
> =Â Â 2872
> Input Gain Specified =Â 1.000
> Â
> 12 and 10
> turns
> Â
> REPORT
> ------
> 0 Position =Â Â Â Â Â 2
> PhaseAngle = 0.417000
> 1 Position =Â 60001 PhaseAngle = 12.454000
> 2
> Position =Â 50001 PhaseAngle = 10.198000
> 3 Position =Â 30002
> PhaseAngle = 6.198000
> Counts per rev =Â 59999
> Counts per cycle
> =Â Â 4985
> Counts per cycle (rounded)=Â Â
> 4980
> invDistPerCycle (rounded)=Â 0.000200803213
> Commutation offset
> =Â Â 2868
> Input Gain Specified =Â 1.000
> Â
> 6 and 10
> turns
> Â
> REPORT
> ------
> 0 Position =Â Â Â Â Â 0
> PhaseAngle = 0.417000
> 1 Position =Â 39999 PhaseAngle = 8.454000
> 2
> Position = -40001 PhaseAngle = -7.802000
> 3 Position = -60002 PhaseAngle =
> -11.802000
> Counts per rev =Â 39999
> Counts per cycle =Â Â
> 4977
> Counts per cycle (rounded)=Â Â 4980
> invDistPerCycle
> (rounded)=Â 0.000200803213
> Commutation offset =Â Â
> 2868
> Input Gain Specified =Â 1.000
> Â
> 4 and 10
> turns
> Â
> Here are
> the settings I used for the APF.c program...
> Â
> #define
> PWM_CHAN 8Â Â Â // which pair of PWM channels used
> #define
> ENCODER_CHANÂ 8Â Â // which encoder we are connected to
> #define
> ENCODER_GAIN 1 Â Â // Set to -1 if desired to reverse axis
> direction
> #define AMPLITUDE 10Â Â Â Â // Set how hard to
> drive the coils pwm counts
> #define Z_BIT_NUMBER 66Â Â // What bit the
> Z index is connected to
> #define CLAMP_VOLTAGE 85Â Â // volts - set a
> few volts higher than your supply
> #define
> AXIS_CHANÂ 0Â Â Â Â Â Â Â Â // Axis channel
> to be used and configured
> #define Ncycles 4Â Â Â // don't change
> this
> Â
> Thank
> you,
> David.
> Â
> Â
>
Group: DynoMotion |
Message: 5995 |
From: Tom Kerekes |
Date: 11/8/2012 |
Subject: Re: Step by Step |
Hi David,
That looks good. Note the counts per cycle is not exact as it depends on how the motor moves which is dependent on friction and so forth, but clearly it should be 2 cycles per rev or 5000 counts/cycle. So the relevant information to be extracted from all that is:
invDistPerCycle=0.0002; Commutationoffset=2987;
Simply putting those two number into the relevant axis configuration and zeroing the encoder at the index mark should allow the motor to commutate (generate torque) properly at any shaft angle.
There are "HomeBrushless" examples that will do this and enable a servo loop. So the next step is to try that and see if you can get the motor to servo (hold position).
I think I have made the appropriate changes in the attached file.
Regards TK
Group: DynoMotion |
Message: 5998 |
From: daveymahomh600e |
Date: 11/9/2012 |
Subject: Re: Step by Step |
Thank you very much Tom.
I will give it a try this morning.
David
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> That looks good. Note the counts per cycle is not exact as it depends on how the motor moves which is dependent on friction and so forth, but clearly it should be 2 cycles per rev or 5000 counts/cycle. So the relevant information to be extracted from all that is:
>
> invDistPerCycle=0.0002;
> Commutationoffset=2987;
>
>
> Simply putting those two number into the relevant axis configuration and zeroing the encoder at the index mark should allow the motor to commutate (generate torque) properly at any shaft angle.
>
> There are "HomeBrushless" examples that will do this and enable a servo loop. So the next step is to try that and see if you can get the motor to servo (hold position).
>
> I think I have made the appropriate changes in the attached file.
>
> Regards
> TK
>
>
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 8, 2012 5:56 PM
> Subject: [DynoMotion] Re: Step by Step
>
>
> Â
> Hi Tom,
>
> The new program seems to have cured that issue. Here are 3 reports...
>
> REPORT
> ------
> 0 Position = 1 PhaseAngle = 0.390600
> 1 Position = 10001 PhaseAngle = 2.396800
> 2 Position = 10002 PhaseAngle = 2.299000
> 3 Position = 2 PhaseAngle = 0.255400
> Counts per rev = 10000
> Counts per cycle = 4985
> Counts per cycle (rounded)= 4980
> invDistPerCycle (rounded)= 0.000200803213
> Commutation offset = 2978
> Input Gain Specified = 1.000
>
> REPORT
> ------
> 0 Position = -1 PhaseAngle = 0.390400
> 1 Position = 9999 PhaseAngle = 2.397600
> 2 Position = 10000 PhaseAngle = 2.298800
> 3 Position = 0 PhaseAngle = 0.255000
> Counts per rev = 10000
> Counts per cycle = 4982
> Counts per cycle (rounded)= 4980
> invDistPerCycle (rounded)= 0.000200803213
> Commutation offset = 2979
> Input Gain Specified = 1.000
>
> REPORT
> ------
> 0 Position = -1 PhaseAngle = 0.390500
> 1 Position = 9999 PhaseAngle = 2.397300
> 2 Position = 10000 PhaseAngle = 2.298900
> 3 Position = 0 PhaseAngle = 0.255100
> Counts per rev = 10000
> Counts per cycle = 4983
> Counts per cycle (rounded)= 4980
> invDistPerCycle (rounded)= 0.000200803213
> Commutation offset = 2979
> Input Gain Specified = 1.000
>
> In each case, the motor shaft rotated once in each direction.
>
> Sooo, the next step is....
>
> Thank you very much,
> David.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> >
> >
> > Hi David,
> >
> > It looks like the Index is not being detected every time.ÃÂ Because the Counts/Rev are always exactly a multiple of 10,000 it appears the encoder and index are working perfectly when it is detected.ÃÂ It just isn't detected every time.
> >
> > You might check the wire and voltages.ÃÂ If one of the + or - signals is not connected the signal can be erratic.ÃÂ Normally the index is not present so the + signal will be high (>3V) and the - signal low (< 0.4V). So you might check those voltages with a volt meter.
> >
> > It might be that the pulse is so short that the software loop misses it.ÃÂ Your encoder is fairly high resolution so the index pulse might be very small.ÃÂ
> >
> >
> > Now that I look at the AutoPhaseFind.c program I see that is actually only checking for the index every millisecond.ÃÂ I've attached a modified program that checks every time slice (180us) which is 5X faster.ÃÂ I've also slowed down the rotation speed about 2X.ÃÂ Please try that.
> >
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: David Stevenson <david.m.stevenson@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 8, 2012 4:24 PM
> > Subject: RE: [DynoMotion] Re: Step by Step
> >
> >
> > ÃÂ
> > 
> > Hi
> > Tom,
> > ÃÂ
> > Here are 4
> > reports, which look a lot better than most have...
> > ÃÂ
> > After each
> > report I noted how many turns (revs) the shaft made... so many in one direction
> > and then so many in the opposite direction. I didn't catch the number for the
> > first set on the first test. I know the encoder is a 2500 ppr, so I expect 10000
> > for a full turn of the shaft.
> > ÃÂ
> > REPORT
> > ------
> > 0 Position =ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ 0
> > PhaseAngle = 0.416000
> > 1 Position =ÃÂ 10000 PhaseAngle = 2.455000
> > 2
> > Position =ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ 1 PhaseAngle = 0.197000
> > 3 Position =
> > -109999 PhaseAngle = -21.803000
> > Counts per rev =ÃÂ 10000
> > Counts per
> > cycle =ÃÂ ÃÂ 4904
> > Counts per cycle (rounded)=ÃÂ ÃÂ
> > 4900
> > invDistPerCycle (rounded)=ÃÂ 0.000204081633
> > Commutation offset
> > =ÃÂ ÃÂ 2822
> > Input Gain Specified =ÃÂ 1.000
> > ÃÂ
> > ? and 10
> > turns
> > ÃÂ
> > REPORT
> > ------
> > 0 Position =ÃÂ ÃÂ ÃÂ ÃÂ -1
> > PhaseAngle = 0.417000
> > 1 Position = 119999 PhaseAngle = 24.455000
> > 2
> > Position =ÃÂ 39998 PhaseAngle = 8.196000
> > 3 Position =ÃÂ 19998
> > PhaseAngle = 4.196000
> > Counts per rev = 120000
> > Counts per cycle
> > =ÃÂ ÃÂ 4992
> > Counts per cycle (rounded)=ÃÂ ÃÂ
> > 4990
> > invDistPerCycle (rounded)=ÃÂ 0.000200400802
> > Commutation offset
> > =ÃÂ ÃÂ 2872
> > Input Gain Specified =ÃÂ 1.000
> > ÃÂ
> > 12 and 10
> > turns
> > ÃÂ
> > REPORT
> > ------
> > 0 Position =ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ 2
> > PhaseAngle = 0.417000
> > 1 Position =ÃÂ 60001 PhaseAngle = 12.454000
> > 2
> > Position =ÃÂ 50001 PhaseAngle = 10.198000
> > 3 Position =ÃÂ 30002
> > PhaseAngle = 6.198000
> > Counts per rev =ÃÂ 59999
> > Counts per cycle
> > =ÃÂ ÃÂ 4985
> > Counts per cycle (rounded)=ÃÂ ÃÂ
> > 4980
> > invDistPerCycle (rounded)=ÃÂ 0.000200803213
> > Commutation offset
> > =ÃÂ ÃÂ 2868
> > Input Gain Specified =ÃÂ 1.000
> > ÃÂ
> > 6 and 10
> > turns
> > ÃÂ
> > REPORT
> > ------
> > 0 Position =ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ 0
> > PhaseAngle = 0.417000
> > 1 Position =ÃÂ 39999 PhaseAngle = 8.454000
> > 2
> > Position = -40001 PhaseAngle = -7.802000
> > 3 Position = -60002 PhaseAngle =
> > -11.802000
> > Counts per rev =ÃÂ 39999
> > Counts per cycle =ÃÂ ÃÂ
> > 4977
> > Counts per cycle (rounded)=ÃÂ ÃÂ 4980
> > invDistPerCycle
> > (rounded)=ÃÂ 0.000200803213
> > Commutation offset =ÃÂ ÃÂ
> > 2868
> > Input Gain Specified =ÃÂ 1.000
> > ÃÂ
> > 4 and 10
> > turns
> > ÃÂ
> > Here are
> > the settings I used for the APF.c program...
> > ÃÂ
> > #define
> > PWM_CHAN 8ÃÂ ÃÂ ÃÂ // which pair of PWM channels used
> > #define
> > ENCODER_CHANÃÂ 8ÃÂ ÃÂ // which encoder we are connected to
> > #define
> > ENCODER_GAIN 1 ÃÂ ÃÂ // Set to -1 if desired to reverse axis
> > direction
> > #define AMPLITUDE 10ÃÂ ÃÂ ÃÂ ÃÂ // Set how hard to
> > drive the coils pwm counts
> > #define Z_BIT_NUMBER 66ÃÂ ÃÂ // What bit the
> > Z index is connected to
> > #define CLAMP_VOLTAGE 85ÃÂ ÃÂ // volts - set a
> > few volts higher than your supply
> > #define
> > AXIS_CHANÃÂ 0ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ // Axis channel
> > to be used and configured
> > #define Ncycles 4ÃÂ ÃÂ ÃÂ // don't change
> > this
> > ÃÂ
> > Thank
> > you,
> > David.
> > ÃÂ
> > ÃÂ
> >
Group: DynoMotion |
Message: 6001 |
From: daveymahomh600e |
Date: 11/9/2012 |
Subject: Re: Step by Step |
Hi Tom,
I loaded the HomeBrushless file and ran it. I couldn't tell if anything happened. Should there be any message on the console screen?
I compared this new Homing file to other similar files and am wondering about the program line (43 in Notepad++) "Write3PH(ch4,0,0); // turn off the coil" should that be ch0?
Anyway I ran the file and tried a move command on the Step Response screen and there was motion which ended with the servo twitching back and forth until disabling it. I changed line 43 to ch0 and ran it again and the plots on Step Response looked much more sensible.
I know there is tuning to do, but does this HomeBrushless file get ultimately added to the init file?
Thanks,
David.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> That looks good. Note the counts per cycle is not exact as it depends on how the motor moves which is dependent on friction and so forth, but clearly it should be 2 cycles per rev or 5000 counts/cycle. So the relevant information to be extracted from all that is:
>
> invDistPerCycle=0.0002;
> Commutationoffset=2987;
>
>
> Simply putting those two number into the relevant axis configuration and zeroing the encoder at the index mark should allow the motor to commutate (generate torque) properly at any shaft angle.
>
> There are "HomeBrushless" examples that will do this and enable a servo loop. So the next step is to try that and see if you can get the motor to servo (hold position).
>
> I think I have made the appropriate changes in the attached file.
>
> Regards
> TK
>
>
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 8, 2012 5:56 PM
> Subject: [DynoMotion] Re: Step by Step
>
>
> Â
> Hi Tom,
>
> The new program seems to have cured that issue. Here are 3 reports...
>
> REPORT
> ------
> 0 Position = 1 PhaseAngle = 0.390600
> 1 Position = 10001 PhaseAngle = 2.396800
> 2 Position = 10002 PhaseAngle = 2.299000
> 3 Position = 2 PhaseAngle = 0.255400
> Counts per rev = 10000
> Counts per cycle = 4985
> Counts per cycle (rounded)= 4980
> invDistPerCycle (rounded)= 0.000200803213
> Commutation offset = 2978
> Input Gain Specified = 1.000
>
> REPORT
> ------
> 0 Position = -1 PhaseAngle = 0.390400
> 1 Position = 9999 PhaseAngle = 2.397600
> 2 Position = 10000 PhaseAngle = 2.298800
> 3 Position = 0 PhaseAngle = 0.255000
> Counts per rev = 10000
> Counts per cycle = 4982
> Counts per cycle (rounded)= 4980
> invDistPerCycle (rounded)= 0.000200803213
> Commutation offset = 2979
> Input Gain Specified = 1.000
>
> REPORT
> ------
> 0 Position = -1 PhaseAngle = 0.390500
> 1 Position = 9999 PhaseAngle = 2.397300
> 2 Position = 10000 PhaseAngle = 2.298900
> 3 Position = 0 PhaseAngle = 0.255100
> Counts per rev = 10000
> Counts per cycle = 4983
> Counts per cycle (rounded)= 4980
> invDistPerCycle (rounded)= 0.000200803213
> Commutation offset = 2979
> Input Gain Specified = 1.000
>
> In each case, the motor shaft rotated once in each direction.
>
> Sooo, the next step is....
>
> Thank you very much,
> David.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> >
> >
> > Hi David,
> >
> > It looks like the Index is not being detected every time.ÃÂ Because the Counts/Rev are always exactly a multiple of 10,000 it appears the encoder and index are working perfectly when it is detected.ÃÂ It just isn't detected every time.
> >
> > You might check the wire and voltages.ÃÂ If one of the + or - signals is not connected the signal can be erratic.ÃÂ Normally the index is not present so the + signal will be high (>3V) and the - signal low (< 0.4V). So you might check those voltages with a volt meter.
> >
> > It might be that the pulse is so short that the software loop misses it.ÃÂ Your encoder is fairly high resolution so the index pulse might be very small.ÃÂ
> >
> >
> > Now that I look at the AutoPhaseFind.c program I see that is actually only checking for the index every millisecond.ÃÂ I've attached a modified program that checks every time slice (180us) which is 5X faster.ÃÂ I've also slowed down the rotation speed about 2X.ÃÂ Please try that.
> >
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: David Stevenson <david.m.stevenson@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 8, 2012 4:24 PM
> > Subject: RE: [DynoMotion] Re: Step by Step
> >
> >
> > ÃÂ
> > 
> > Hi
> > Tom,
> > ÃÂ
> > Here are 4
> > reports, which look a lot better than most have...
> > ÃÂ
> > After each
> > report I noted how many turns (revs) the shaft made... so many in one direction
> > and then so many in the opposite direction. I didn't catch the number for the
> > first set on the first test. I know the encoder is a 2500 ppr, so I expect 10000
> > for a full turn of the shaft.
> > ÃÂ
> > REPORT
> > ------
> > 0 Position =ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ 0
> > PhaseAngle = 0.416000
> > 1 Position =ÃÂ 10000 PhaseAngle = 2.455000
> > 2
> > Position =ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ 1 PhaseAngle = 0.197000
> > 3 Position =
> > -109999 PhaseAngle = -21.803000
> > Counts per rev =ÃÂ 10000
> > Counts per
> > cycle =ÃÂ ÃÂ 4904
> > Counts per cycle (rounded)=ÃÂ ÃÂ
> > 4900
> > invDistPerCycle (rounded)=ÃÂ 0.000204081633
> > Commutation offset
> > =ÃÂ ÃÂ 2822
> > Input Gain Specified =ÃÂ 1.000
> > ÃÂ
> > ? and 10
> > turns
> > ÃÂ
> > REPORT
> > ------
> > 0 Position =ÃÂ ÃÂ ÃÂ ÃÂ -1
> > PhaseAngle = 0.417000
> > 1 Position = 119999 PhaseAngle = 24.455000
> > 2
> > Position =ÃÂ 39998 PhaseAngle = 8.196000
> > 3 Position =ÃÂ 19998
> > PhaseAngle = 4.196000
> > Counts per rev = 120000
> > Counts per cycle
> > =ÃÂ ÃÂ 4992
> > Counts per cycle (rounded)=ÃÂ ÃÂ
> > 4990
> > invDistPerCycle (rounded)=ÃÂ 0.000200400802
> > Commutation offset
> > =ÃÂ ÃÂ 2872
> > Input Gain Specified =ÃÂ 1.000
> > ÃÂ
> > 12 and 10
> > turns
> > ÃÂ
> > REPORT
> > ------
> > 0 Position =ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ 2
> > PhaseAngle = 0.417000
> > 1 Position =ÃÂ 60001 PhaseAngle = 12.454000
> > 2
> > Position =ÃÂ 50001 PhaseAngle = 10.198000
> > 3 Position =ÃÂ 30002
> > PhaseAngle = 6.198000
> > Counts per rev =ÃÂ 59999
> > Counts per cycle
> > =ÃÂ ÃÂ 4985
> > Counts per cycle (rounded)=ÃÂ ÃÂ
> > 4980
> > invDistPerCycle (rounded)=ÃÂ 0.000200803213
> > Commutation offset
> > =ÃÂ ÃÂ 2868
> > Input Gain Specified =ÃÂ 1.000
> > ÃÂ
> > 6 and 10
> > turns
> > ÃÂ
> > REPORT
> > ------
> > 0 Position =ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ 0
> > PhaseAngle = 0.417000
> > 1 Position =ÃÂ 39999 PhaseAngle = 8.454000
> > 2
> > Position = -40001 PhaseAngle = -7.802000
> > 3 Position = -60002 PhaseAngle =
> > -11.802000
> > Counts per rev =ÃÂ 39999
> > Counts per cycle =ÃÂ ÃÂ
> > 4977
> > Counts per cycle (rounded)=ÃÂ ÃÂ 4980
> > invDistPerCycle
> > (rounded)=ÃÂ 0.000200803213
> > Commutation offset =ÃÂ ÃÂ
> > 2868
> > Input Gain Specified =ÃÂ 1.000
> > ÃÂ
> > 4 and 10
> > turns
> > ÃÂ
> > Here are
> > the settings I used for the APF.c program...
> > ÃÂ
> > #define
> > PWM_CHAN 8ÃÂ ÃÂ ÃÂ // which pair of PWM channels used
> > #define
> > ENCODER_CHANÃÂ 8ÃÂ ÃÂ // which encoder we are connected to
> > #define
> > ENCODER_GAIN 1 ÃÂ ÃÂ // Set to -1 if desired to reverse axis
> > direction
> > #define AMPLITUDE 10ÃÂ ÃÂ ÃÂ ÃÂ // Set how hard to
> > drive the coils pwm counts
> > #define Z_BIT_NUMBER 66ÃÂ ÃÂ // What bit the
> > Z index is connected to
> > #define CLAMP_VOLTAGE 85ÃÂ ÃÂ // volts - set a
> > few volts higher than your supply
> > #define
> > AXIS_CHANÃÂ 0ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ // Axis channel
> > to be used and configured
> > #define Ncycles 4ÃÂ ÃÂ ÃÂ // don't change
> > this
> > ÃÂ
> > Thank
> > you,
> > David.
> > ÃÂ
> > ÃÂ
> >
Group: DynoMotion |
Message: 6002 |
From: Tom Kerekes |
Date: 11/9/2012 |
Subject: Re: Step by Step |
Hi David, Nothing should really happen when you run the program except the motor should remain still and not run away. It should be servoing. That is if you push the motor by hand it should resist and try to return back to where it was. The gain is probably very low so the response will be very poor but the idea is to see that functionally it is working. A good thing to check at this stage is that the commutation is really working properly. As you push the motor away the motor torque should increase up to the maximum we have set as the MaxOutput Parameter. If we continue to push the motor further away, for example 2 revs, the torque should remain constant and in the same direction. If the commutation is not working correctly the torque will vary or even reverse. It is normal for a
motor's torque to vary a bit (~10% torque ripple), but not more than that. My mistake on the ch4. You are using ch0 so correct everything should be ch0. I doubt if that would make any real difference. It just wouldn't turn off the coil current after finding the index, but as soon as the servo is turned on, the servo will write new coil currents anyway. I'm not sure why it made a difference for you. Making a "Move" on the Step Response Screen downloads all axis parameters from the Step, Config, and Filter Screens. So make sure they are all set to reasonable values and match what is in the HomeBrushless.c program. An easy way to do this is to "Upload" the parameters from KFLOP to the Screens (after running the HomeBrushless.c program). There is a Flash video that explains the interaction between the various ways to change parameters.
See: http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html Plot the Response of a Move and post it so we can see it (one method is to Alt-Print-Screen, paste to Paint.exe, save as *.png file). If you also save the raw data we can zoom, and plot the data ourselves in various ways. Don't really worry about the Init.c file at this point, but yes, after everything is working you can make one Init.c file that does everything, configures, enables, phasefinds, homes, etc... Whatever you wish. Regards TK
Group: DynoMotion |
Message: 6006 |
From: daveymahomh600e |
Date: 11/9/2012 |
Subject: Re: Step by Step |
Hi Tom,
I have uploaded a zip file called Response Plots to the file area for all to see.
Thank you,
David.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> Nothing should really happen when you run the program except the motor should remain still and not run away. It should be servoing. That is if you push the motor by hand it should resist and try to return back to where it was. The gain is probably very low so the response will be very poor but the idea is to see that functionally it is working. A good thing to check at this stage is that the commutation is really working properly. As you push the motor away the motor torque should increase up to the maximum we have set as the MaxOutput Parameter. If we continue to push the motor further away, for example 2 revs, the torque should remain constant and in the same direction. If the commutation is not working correctly the torque will vary or even reverse. It is normal for a motor's torque to vary a bit (~10% torque ripple), but not more than that.
>
> My mistake on the ch4. You are using ch0 so correct everything should be ch0. I doubt if that would make any real difference. It just wouldn't turn off the coil current after finding the index, but as soon as the servo is turned on, the servo will write new coil currents anyway. I'm not sure why it made a difference for you.
>
> Making a "Move" on the Step Response Screen downloads all axis parameters from the Step, Config, and Filter Screens. So make sure they are all set to reasonable values and match what is in the HomeBrushless.c program. An easy way to do this is to "Upload" the parameters from KFLOP to the Screens (after running the HomeBrushless.c program). There is a Flash video that explains the interaction between the various ways to change parameters. See:
>
> http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
>
> Plot the Response of a Move and post it so we can see it (one method is to Alt-Print-Screen, paste to Paint.exe, save as *.png file). If you also save the raw data we can zoom, and plot the data ourselves in various ways.
>
> Don't really worry about the Init.c file at this point, but yes, after everything is working you can make one Init.c file that does everything, configures, enables, phasefinds, homes, etc... Whatever you wish.
>
> Regards
> TK
>
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 9, 2012 8:20 AM
> Subject: [DynoMotion] Re: Step by Step
>
>
> Â
> Hi Tom,
>
> I loaded the HomeBrushless file and ran it. I couldn't tell if anything happened. Should there be any message on the console screen?
>
> I compared this new Homing file to other similar files and am wondering about the program line (43 in Notepad++) "Write3PH(ch4,0,0); // turn off the coil" should that be ch0?
>
> Anyway I ran the file and tried a move command on the Step Response screen and there was motion which ended with the servo twitching back and forth until disabling it. I changed line 43 to ch0 and ran it again and the plots on Step Response looked much more sensible.
>
> I know there is tuning to do, but does this HomeBrushless file get ultimately added to the init file?
>
> Thanks,
> David.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi David,
> >
> > That looks good.ÃÂ Note the counts per cycle is not exact as it depends on how the motor moves which is dependent on friction and so forth, but clearly it should be 2 cycles per rev or 5000 counts/cycle.ÃÂ So the relevant information to be extracted from all that is:
> >
> > invDistPerCycle=0.0002;
> > Commutationoffset=2987;
> >
> >
> > Simply putting those two number into the relevant axis configuration and zeroing the encoder at the index mark should allow the motor to commutate (generate torque) properly at any shaft angle.
> >
> > There are "HomeBrushless" examples that will do this and enable a servo loop.ÃÂ So the next step is to try that and see if you can get the motor to servo (hold position).
> >
> > I think I have made the appropriate changes in the attached file.
> >
> > Regards
> > TK
> >
> >
> >
> >
> >
> >
> > ________________________________
> > From: daveymahomh600e <david.m.stevenson@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, November 8, 2012 5:56 PM
> > Subject: [DynoMotion] Re: Step by Step
> >
> >
> > ÃÂ
> > Hi Tom,
> >
> > The new program seems to have cured that issue. Here are 3 reports...
> >
> > REPORT
> > ------
> > 0 Position = 1 PhaseAngle = 0.390600
> > 1 Position = 10001 PhaseAngle = 2.396800
> > 2 Position = 10002 PhaseAngle = 2.299000
> > 3 Position = 2 PhaseAngle = 0.255400
> > Counts per rev = 10000
> > Counts per cycle = 4985
> > Counts per cycle (rounded)= 4980
> > invDistPerCycle (rounded)= 0.000200803213
> > Commutation offset = 2978
> > Input Gain Specified = 1.000
> >
> > REPORT
> > ------
> > 0 Position = -1 PhaseAngle = 0.390400
> > 1 Position = 9999 PhaseAngle = 2.397600
> > 2 Position = 10000 PhaseAngle = 2.298800
> > 3 Position = 0 PhaseAngle = 0.255000
> > Counts per rev = 10000
> > Counts per cycle = 4982
> > Counts per cycle (rounded)= 4980
> > invDistPerCycle (rounded)= 0.000200803213
> > Commutation offset = 2979
> > Input Gain Specified = 1.000
> >
> > REPORT
> > ------
> > 0 Position = -1 PhaseAngle = 0.390500
> > 1 Position = 9999 PhaseAngle = 2.397300
> > 2 Position = 10000 PhaseAngle = 2.298900
> > 3 Position = 0 PhaseAngle = 0.255100
> > Counts per rev = 10000
> > Counts per cycle = 4983
> > Counts per cycle (rounded)= 4980
> > invDistPerCycle (rounded)= 0.000200803213
> > Commutation offset = 2979
> > Input Gain Specified = 1.000
> >
> > In each case, the motor shaft rotated once in each direction.
> >
> > Sooo, the next step is....
> >
> > Thank you very much,
> > David.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > >
> > >
> > > Hi David,
> > >
> > > It looks like the Index is not being detected every time.ÃâàBecause the Counts/Rev are always exactly a multiple of 10,000 it appears the encoder and index are working perfectly when it is detected.ÃâàIt just isn't detected every time.
> > >
> > > You might check the wire and voltages.ÃâàIf one of the + or - signals is not connected the signal can be erratic.ÃâàNormally the index is not present so the + signal will be high (>3V) and the - signal low (< 0.4V). So you might check those voltages with a volt meter.
> > >
> > > It might be that the pulse is so short that the software loop misses it.ÃâàYour encoder is fairly high resolution so the index pulse might be very small.ÃâÃÂ
> > >
> > >
> > > Now that I look at the AutoPhaseFind.c program I see that is actually only checking for the index every millisecond.ÃâàI've attached a modified program that checks every time slice (180us) which is 5X faster.ÃâàI've also slowed down the rotation speed about 2X.ÃâàPlease try that.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: David Stevenson <david.m.stevenson@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, November 8, 2012 4:24 PM
> > > Subject: RE: [DynoMotion] Re: Step by Step
> > >
> > >
> > > ÃâÃÂ
> > > ïûÿ
> > > Hi
> > > Tom,
> > > ÃâÃÂ
> > > Here are 4
> > > reports, which look a lot better than most have...
> > > ÃâÃÂ
> > > After each
> > > report I noted how many turns (revs) the shaft made... so many in one direction
> > > and then so many in the opposite direction. I didn't catch the number for the
> > > first set on the first test. I know the encoder is a 2500 ppr, so I expect 10000
> > > for a full turn of the shaft.
> > > ÃâÃÂ
> > > REPORT
> > > ------
> > > 0 Position =ÃâàÃâàÃâàÃâàÃâà0
> > > PhaseAngle = 0.416000
> > > 1 Position =Ãâà10000 PhaseAngle = 2.455000
> > > 2
> > > Position =ÃâàÃâàÃâàÃâàÃâà1 PhaseAngle = 0.197000
> > > 3 Position =
> > > -109999 PhaseAngle = -21.803000
> > > Counts per rev =Ãâà10000
> > > Counts per
> > > cycle =ÃâàÃâà4904
> > > Counts per cycle (rounded)=ÃâàÃâÃÂ
> > > 4900
> > > invDistPerCycle (rounded)=Ãâà0.000204081633
> > > Commutation offset
> > > =ÃâàÃâà2822
> > > Input Gain Specified =Ãâà1.000
> > > ÃâÃÂ
> > > ? and 10
> > > turns
> > > ÃâÃÂ
> > > REPORT
> > > ------
> > > 0 Position =ÃâàÃâàÃâàÃâà-1
> > > PhaseAngle = 0.417000
> > > 1 Position = 119999 PhaseAngle = 24.455000
> > > 2
> > > Position =Ãâà39998 PhaseAngle = 8.196000
> > > 3 Position =Ãâà19998
> > > PhaseAngle = 4.196000
> > > Counts per rev = 120000
> > > Counts per cycle
> > > =ÃâàÃâà4992
> > > Counts per cycle (rounded)=ÃâàÃâÃÂ
> > > 4990
> > > invDistPerCycle (rounded)=Ãâà0.000200400802
> > > Commutation offset
> > > =ÃâàÃâà2872
> > > Input Gain Specified =Ãâà1.000
> > > ÃâÃÂ
> > > 12 and 10
> > > turns
> > > ÃâÃÂ
> > > REPORT
> > > ------
> > > 0 Position =ÃâàÃâàÃâàÃâàÃâà2
> > > PhaseAngle = 0.417000
> > > 1 Position =Ãâà60001 PhaseAngle = 12.454000
> > > 2
> > > Position =Ãâà50001 PhaseAngle = 10.198000
> > > 3 Position =Ãâà30002
> > > PhaseAngle = 6.198000
> > > Counts per rev =Ãâà59999
> > > Counts per cycle
> > > =ÃâàÃâà4985
> > > Counts per cycle (rounded)=ÃâàÃâÃÂ
> > > 4980
> > > invDistPerCycle (rounded)=Ãâà0.000200803213
> > > Commutation offset
> > > =ÃâàÃâà2868
> > > Input Gain Specified =Ãâà1.000
> > > ÃâÃÂ
> > > 6 and 10
> > > turns
> > > ÃâÃÂ
> > > REPORT
> > > ------
> > > 0 Position =ÃâàÃâàÃâàÃâàÃâà0
> > > PhaseAngle = 0.417000
> > > 1 Position =Ãâà39999 PhaseAngle = 8.454000
> > > 2
> > > Position = -40001 PhaseAngle = -7.802000
> > > 3 Position = -60002 PhaseAngle =
> > > -11.802000
> > > Counts per rev =Ãâà39999
> > > Counts per cycle =ÃâàÃâÃÂ
> > > 4977
> > > Counts per cycle (rounded)=ÃâàÃâà4980
> > > invDistPerCycle
> > > (rounded)=Ãâà0.000200803213
> > > Commutation offset =ÃâàÃâÃÂ
> > > 2868
> > > Input Gain Specified =Ãâà1.000
> > > ÃâÃÂ
> > > 4 and 10
> > > turns
> > > ÃâÃÂ
> > > Here are
> > > the settings I used for the APF.c program...
> > > ÃâÃÂ
> > > #define
> > > PWM_CHAN 8ÃâàÃâàÃâà// which pair of PWM channels used
> > > #define
> > > ENCODER_CHANÃâà8ÃâàÃâà// which encoder we are connected to
> > > #define
> > > ENCODER_GAIN 1 ÃâàÃâà// Set to -1 if desired to reverse axis
> > > direction
> > > #define AMPLITUDE 10ÃâàÃâàÃâàÃâà// Set how hard to
> > > drive the coils pwm counts
> > > #define Z_BIT_NUMBER 66ÃâàÃâà// What bit the
> > > Z index is connected to
> > > #define CLAMP_VOLTAGE 85ÃâàÃâà// volts - set a
> > > few volts higher than your supply
> > > #define
> > > AXIS_CHANÃâà0ÃâàÃâàÃâàÃâàÃâàÃâàÃâàÃâà// Axis channel
> > > to be used and configured
> > > #define Ncycles 4ÃâàÃâàÃâà// don't change
> > > this
> > > ÃâÃÂ
> > > Thank
> > > you,
> > > David.
> > > ÃâÃÂ
> > > ÃâÃÂ
> > >
Group: DynoMotion |
Message: 6009 |
From: Tom Kerekes |
Date: 11/9/2012 |
Subject: Re: Step by Step |
Hi David,
In the future please provide more info besides just files. In general: what you did, what happened, what your understanding is, whether or not you performed the tests previously asked, etc... It just reduces the guesswork on our end and the number of emails to resolve an issue.
But from the plots I see:
#1 motor currents flowing of ~8A through the motor - so I'm assuming it really moved
#2 no encoder position
change at all
I see a bug in the C code. The encoder channel was specified as 4 rather than 8.
change:
ch0->InputChan0=4;
to
ch0->InputChan0=8;
Then the Encoder Position should change when the motor moves.
The basic commutation and servo tests would have failed also because of no encoder motion or error.
Regards TK
Group: DynoMotion |
Message: 6011 |
From: daveymahomh600e |
Date: 11/9/2012 |
Subject: Re: Step by Step |
Hi Tom,
I was focused on uploading the files and neglected to offer any explanation. Sorry.
When I requested a move of 1000 the shaft rotated about 30 degrees (probably 36) in one direction only.
I have since changed the code to correct the input channel, but when I ran the 1000 move after the HomeBrushless, nothing moved. The shaft seems to be pulsing slightly and if I turn it, it jumps about 10 degrees.
Tomorrow I will run the procedure again and post some more plots.
Thanks,
David.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> In the future please provide more info besides just files. In general: what you did, what happened, what your understanding is, whether or not you performed the tests previously asked, etc... It just reduces the guesswork on our end and the number of emails to resolve an issue.
>
> But from the plots I see:
>
> #1 motor currents flowing of ~8A through the motor - so I'm assuming it really moved
>
> #2 no encoder position change at all
>
>
> I see a bug in the C code. The encoder channel was specified as 4 rather than 8.
>
> change:
>
>
> Â Â Â ch0->InputChan0=4;
>
>
> to
>
> Â Â Â ch0->InputChan0=8;
>
> Then the Encoder Position should change when the motor moves.
>
>
> The basic commutation and servo tests would have failed also because of no encoder motion or error.
>
> Regards
> TK
>
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 9, 2012 12:35 PM
> Subject: [DynoMotion] Re: Step by Step
>
>
> Â
> Hi Tom,
>
> I have uploaded a zip file called Response Plots to the file area for all to see.
>
> Thank you,
> David.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi David,
> >
> > Nothing should really happen when you run the program except the motor should remain still and not run away.ÃÂ It should be servoing.ÃÂ That is if you push the motor by hand it should resist and try to return back to where it was.ÃÂ The gain is probably very low so the response will be very poor but the idea is to see that functionally it is working.ÃÂ A good thing to check at this stage is that the commutation is really working properly.ÃÂ As you push the motor away the motor torque should increase up to the maximum we have set as the MaxOutput Parameter.ÃÂ If we continue to push the motor further away, for example 2 revs, the torque should remain constant and in the same direction.ÃÂ If the commutation is not working correctly the torque will vary or even reverse.ÃÂ It is normal for a motor's torque to vary a bit (~10% torque ripple), but not more than that.
> >
> > My mistake on the ch4.ÃÂ You are using ch0 so correct everything should be ch0.ÃÂ I doubt if that would make any real difference.ÃÂ It just wouldn't turn off the coil current after finding the index, but as soon as the servo is turned on, the servo will write new coil currents anyway.ÃÂ I'm not sure why it made a difference for you.
> >
> > Making a "Move" on the Step Response Screen downloads all axis parameters from the Step, Config, and Filter Screens. So make sure they are all set to reasonable values and match what is in the HomeBrushless.c program.ÃÂ An easy way to do this is to "Upload" the parameters from KFLOP to the Screens (after running the HomeBrushless.c program).ÃÂ There is a Flash video that explains the interaction between the various ways to change parameters.ÃÂ See:
> >
> > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> >
> > Plot the Response of a Move and post it so we can see it (one method is to Alt-Print-Screen, paste to Paint.exe, save as *.png file).ÃÂ If you also save the raw data we can zoom, and plot the data ourselves in various ways.
> >
> > Don't really worry about the Init.c file at this point, but yes, after everything is working you can make one Init.c file that does everything, configures, enables, phasefinds, homes, etc...ÃÂ Whatever you wish.
> >
> > Regards
> > TK
> >
> >
> >
> >
> >
> > ________________________________
> > From: daveymahomh600e <david.m.stevenson@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, November 9, 2012 8:20 AM
> > Subject: [DynoMotion] Re: Step by Step
> >
> >
> > ÃÂ
> > Hi Tom,
> >
> > I loaded the HomeBrushless file and ran it. I couldn't tell if anything happened. Should there be any message on the console screen?
> >
> > I compared this new Homing file to other similar files and am wondering about the program line (43 in Notepad++) "Write3PH(ch4,0,0); // turn off the coil" should that be ch0?
> >
> > Anyway I ran the file and tried a move command on the Step Response screen and there was motion which ended with the servo twitching back and forth until disabling it. I changed line 43 to ch0 and ran it again and the plots on Step Response looked much more sensible.
> >
> > I know there is tuning to do, but does this HomeBrushless file get ultimately added to the init file?
> >
> > Thanks,
> > David.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi David,
> > >
> > > That looks good.ÃâàNote the counts per cycle is not exact as it depends on how the motor moves which is dependent on friction and so forth, but clearly it should be 2 cycles per rev or 5000 counts/cycle.ÃâàSo the relevant information to be extracted from all that is:
> > >
> > > invDistPerCycle=0.0002;
> > > Commutationoffset=2987;
> > >
> > >
> > > Simply putting those two number into the relevant axis configuration and zeroing the encoder at the index mark should allow the motor to commutate (generate torque) properly at any shaft angle.
> > >
> > > There are "HomeBrushless" examples that will do this and enable a servo loop.ÃâàSo the next step is to try that and see if you can get the motor to servo (hold position).
> > >
> > > I think I have made the appropriate changes in the attached file.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: daveymahomh600e <david.m.stevenson@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, November 8, 2012 5:56 PM
> > > Subject: [DynoMotion] Re: Step by Step
> > >
> > >
> > > ÃâÃÂ
> > > Hi Tom,
> > >
> > > The new program seems to have cured that issue. Here are 3 reports...
> > >
> > > REPORT
> > > ------
> > > 0 Position = 1 PhaseAngle = 0.390600
> > > 1 Position = 10001 PhaseAngle = 2.396800
> > > 2 Position = 10002 PhaseAngle = 2.299000
> > > 3 Position = 2 PhaseAngle = 0.255400
> > > Counts per rev = 10000
> > > Counts per cycle = 4985
> > > Counts per cycle (rounded)= 4980
> > > invDistPerCycle (rounded)= 0.000200803213
> > > Commutation offset = 2978
> > > Input Gain Specified = 1.000
> > >
> > > REPORT
> > > ------
> > > 0 Position = -1 PhaseAngle = 0.390400
> > > 1 Position = 9999 PhaseAngle = 2.397600
> > > 2 Position = 10000 PhaseAngle = 2.298800
> > > 3 Position = 0 PhaseAngle = 0.255000
> > > Counts per rev = 10000
> > > Counts per cycle = 4982
> > > Counts per cycle (rounded)= 4980
> > > invDistPerCycle (rounded)= 0.000200803213
> > > Commutation offset = 2979
> > > Input Gain Specified = 1.000
> > >
> > > REPORT
> > > ------
> > > 0 Position = -1 PhaseAngle = 0.390500
> > > 1 Position = 9999 PhaseAngle = 2.397300
> > > 2 Position = 10000 PhaseAngle = 2.298900
> > > 3 Position = 0 PhaseAngle = 0.255100
> > > Counts per rev = 10000
> > > Counts per cycle = 4983
> > > Counts per cycle (rounded)= 4980
> > > invDistPerCycle (rounded)= 0.000200803213
> > > Commutation offset = 2979
> > > Input Gain Specified = 1.000
> > >
> > > In each case, the motor shaft rotated once in each direction.
> > >
> > > Sooo, the next step is....
> > >
> > > Thank you very much,
> > > David.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > >
> > > >
> > > > Hi David,
> > > >
> > > > It looks like the Index is not being detected every time.ÃÆ'ââ¬Å¡ÃâàBecause the Counts/Rev are always exactly a multiple of 10,000 it appears the encoder and index are working perfectly when it is detected.ÃÆ'ââ¬Å¡ÃâàIt just isn't detected every time.
> > > >
> > > > You might check the wire and voltages.ÃÆ'ââ¬Å¡ÃâàIf one of the + or - signals is not connected the signal can be erratic.ÃÆ'ââ¬Å¡ÃâàNormally the index is not present so the + signal will be high (>3V) and the - signal low (< 0.4V). So you might check those voltages with a volt meter.
> > > >
> > > > It might be that the pulse is so short that the software loop misses it.ÃÆ'ââ¬Å¡ÃâàYour encoder is fairly high resolution so the index pulse might be very small.ÃÆ'ââ¬Å¡ÃâÃÂ
> > > >
> > > >
> > > > Now that I look at the AutoPhaseFind.c program I see that is actually only checking for the index every millisecond.ÃÆ'ââ¬Å¡ÃâàI've attached a modified program that checks every time slice (180us) which is 5X faster.ÃÆ'ââ¬Å¡ÃâàI've also slowed down the rotation speed about 2X.ÃÆ'ââ¬Å¡ÃâàPlease try that.
> > > >
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: David Stevenson <david.m.stevenson@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, November 8, 2012 4:24 PM
> > > > Subject: RE: [DynoMotion] Re: Step by Step
> > > >
> > > >
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > ÃÆ'ïÃâûÃâÿ
> > > > Hi
> > > > Tom,
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Here are 4
> > > > reports, which look a lot better than most have...
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > After each
> > > > report I noted how many turns (revs) the shaft made... so many in one direction
> > > > and then so many in the opposite direction. I didn't catch the number for the
> > > > first set on the first test. I know the encoder is a 2500 ppr, so I expect 10000
> > > > for a full turn of the shaft.
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > REPORT
> > > > ------
> > > > 0 Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà0
> > > > PhaseAngle = 0.416000
> > > > 1 Position =ÃÆ'ââ¬Å¡Ãâà10000 PhaseAngle = 2.455000
> > > > 2
> > > > Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà1 PhaseAngle = 0.197000
> > > > 3 Position =
> > > > -109999 PhaseAngle = -21.803000
> > > > Counts per rev =ÃÆ'ââ¬Å¡Ãâà10000
> > > > Counts per
> > > > cycle =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà4904
> > > > Counts per cycle (rounded)=ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > 4900
> > > > invDistPerCycle (rounded)=ÃÆ'ââ¬Å¡Ãâà0.000204081633
> > > > Commutation offset
> > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà2822
> > > > Input Gain Specified =ÃÆ'ââ¬Å¡Ãâà1.000
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > ? and 10
> > > > turns
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > REPORT
> > > > ------
> > > > 0 Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà-1
> > > > PhaseAngle = 0.417000
> > > > 1 Position = 119999 PhaseAngle = 24.455000
> > > > 2
> > > > Position =ÃÆ'ââ¬Å¡Ãâà39998 PhaseAngle = 8.196000
> > > > 3 Position =ÃÆ'ââ¬Å¡Ãâà19998
> > > > PhaseAngle = 4.196000
> > > > Counts per rev = 120000
> > > > Counts per cycle
> > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà4992
> > > > Counts per cycle (rounded)=ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > 4990
> > > > invDistPerCycle (rounded)=ÃÆ'ââ¬Å¡Ãâà0.000200400802
> > > > Commutation offset
> > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà2872
> > > > Input Gain Specified =ÃÆ'ââ¬Å¡Ãâà1.000
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > 12 and 10
> > > > turns
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > REPORT
> > > > ------
> > > > 0 Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà2
> > > > PhaseAngle = 0.417000
> > > > 1 Position =ÃÆ'ââ¬Å¡Ãâà60001 PhaseAngle = 12.454000
> > > > 2
> > > > Position =ÃÆ'ââ¬Å¡Ãâà50001 PhaseAngle = 10.198000
> > > > 3 Position =ÃÆ'ââ¬Å¡Ãâà30002
> > > > PhaseAngle = 6.198000
> > > > Counts per rev =ÃÆ'ââ¬Å¡Ãâà59999
> > > > Counts per cycle
> > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà4985
> > > > Counts per cycle (rounded)=ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > 4980
> > > > invDistPerCycle (rounded)=ÃÆ'ââ¬Å¡Ãâà0.000200803213
> > > > Commutation offset
> > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà2868
> > > > Input Gain Specified =ÃÆ'ââ¬Å¡Ãâà1.000
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > 6 and 10
> > > > turns
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > REPORT
> > > > ------
> > > > 0 Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà0
> > > > PhaseAngle = 0.417000
> > > > 1 Position =ÃÆ'ââ¬Å¡Ãâà39999 PhaseAngle = 8.454000
> > > > 2
> > > > Position = -40001 PhaseAngle = -7.802000
> > > > 3 Position = -60002 PhaseAngle =
> > > > -11.802000
> > > > Counts per rev =ÃÆ'ââ¬Å¡Ãâà39999
> > > > Counts per cycle =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > 4977
> > > > Counts per cycle (rounded)=ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà4980
> > > > invDistPerCycle
> > > > (rounded)=ÃÆ'ââ¬Å¡Ãâà0.000200803213
> > > > Commutation offset =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > 2868
> > > > Input Gain Specified =ÃÆ'ââ¬Å¡Ãâà1.000
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > 4 and 10
> > > > turns
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Here are
> > > > the settings I used for the APF.c program...
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > #define
> > > > PWM_CHAN 8ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// which pair of PWM channels used
> > > > #define
> > > > ENCODER_CHANÃÆ'ââ¬Å¡Ãâà8ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// which encoder we are connected to
> > > > #define
> > > > ENCODER_GAIN 1 ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// Set to -1 if desired to reverse axis
> > > > direction
> > > > #define AMPLITUDE 10ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// Set how hard to
> > > > drive the coils pwm counts
> > > > #define Z_BIT_NUMBER 66ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// What bit the
> > > > Z index is connected to
> > > > #define CLAMP_VOLTAGE 85ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// volts - set a
> > > > few volts higher than your supply
> > > > #define
> > > > AXIS_CHANÃÆ'ââ¬Å¡Ãâà0ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// Axis channel
> > > > to be used and configured
> > > > #define Ncycles 4ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// don't change
> > > > this
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Thank
> > > > you,
> > > > David.
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > >
Group: DynoMotion |
Message: 6019 |
From: daveymahomh600e |
Date: 11/10/2012 |
Subject: Re: Step by Step |
Hello Tom,
I updated the HomeBrushless file and re-ran it this morning.
This time the motion of the shaft was as expected... about 1/10th turn left, then the same back when I ran a move of 1000 counts.
There is force on the shaft so I expect it is servoing.
The plots and data have been uploaded as file Response Plots 2.zip
Any feedback would be greatly appreciated.
Thank you,
David.
--- In DynoMotion@yahoogroups.com, "daveymahomh600e" <david.m.stevenson@...> wrote:
>
> Hi Tom,
>
> I was focused on uploading the files and neglected to offer any explanation. Sorry.
>
> When I requested a move of 1000 the shaft rotated about 30 degrees (probably 36) in one direction only.
>
> I have since changed the code to correct the input channel, but when I ran the 1000 move after the HomeBrushless, nothing moved. The shaft seems to be pulsing slightly and if I turn it, it jumps about 10 degrees.
>
> Tomorrow I will run the procedure again and post some more plots.
>
> Thanks,
> David.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi David,
> >
> > In the future please provide more info besides just files. In general: what you did, what happened, what your understanding is, whether or not you performed the tests previously asked, etc... It just reduces the guesswork on our end and the number of emails to resolve an issue.
> >
> > But from the plots I see:
> >
> > #1 motor currents flowing of ~8A through the motor - so I'm assuming it really moved
> >
> > #2 no encoder position change at all
> >
> >
> > I see a bug in the C code. The encoder channel was specified as 4 rather than 8.
> >
> > change:
> >
> >
> > Â Â Â ch0->InputChan0=4;
> >
> >
> > to
> >
> > Â Â Â ch0->InputChan0=8;
> >
> > Then the Encoder Position should change when the motor moves.
> >
> >
> > The basic commutation and servo tests would have failed also because of no encoder motion or error.
> >
> > Regards
> > TK
> >
> >
> >
> >
> >
> > ________________________________
> > From: daveymahomh600e <david.m.stevenson@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, November 9, 2012 12:35 PM
> > Subject: [DynoMotion] Re: Step by Step
> >
> >
> > Â
> > Hi Tom,
> >
> > I have uploaded a zip file called Response Plots to the file area for all to see.
> >
> > Thank you,
> > David.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi David,
> > >
> > > Nothing should really happen when you run the program except the motor should remain still and not run away.ÃÂ It should be servoing.ÃÂ That is if you push the motor by hand it should resist and try to return back to where it was.ÃÂ The gain is probably very low so the response will be very poor but the idea is to see that functionally it is working.ÃÂ A good thing to check at this stage is that the commutation is really working properly.ÃÂ As you push the motor away the motor torque should increase up to the maximum we have set as the MaxOutput Parameter.ÃÂ If we continue to push the motor further away, for example 2 revs, the torque should remain constant and in the same direction.ÃÂ If the commutation is not working correctly the torque will vary or even reverse.ÃÂ It is normal for a motor's torque to vary a bit (~10% torque ripple), but not more than that.
> > >
> > > My mistake on the ch4.ÃÂ You are using ch0 so correct everything should be ch0.ÃÂ I doubt if that would make any real difference.ÃÂ It just wouldn't turn off the coil current after finding the index, but as soon as the servo is turned on, the servo will write new coil currents anyway.ÃÂ I'm not sure why it made a difference for you.
> > >
> > > Making a "Move" on the Step Response Screen downloads all axis parameters from the Step, Config, and Filter Screens. So make sure they are all set to reasonable values and match what is in the HomeBrushless.c program.ÃÂ An easy way to do this is to "Upload" the parameters from KFLOP to the Screens (after running the HomeBrushless.c program).ÃÂ There is a Flash video that explains the interaction between the various ways to change parameters.ÃÂ See:
> > >
> > > http://www.dynomotion.com/Help/FlashHelp/Parameters/index.html
> > >
> > > Plot the Response of a Move and post it so we can see it (one method is to Alt-Print-Screen, paste to Paint.exe, save as *.png file).ÃÂ If you also save the raw data we can zoom, and plot the data ourselves in various ways.
> > >
> > > Don't really worry about the Init.c file at this point, but yes, after everything is working you can make one Init.c file that does everything, configures, enables, phasefinds, homes, etc...ÃÂ Whatever you wish.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: daveymahomh600e <david.m.stevenson@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Friday, November 9, 2012 8:20 AM
> > > Subject: [DynoMotion] Re: Step by Step
> > >
> > >
> > > ÃÂ
> > > Hi Tom,
> > >
> > > I loaded the HomeBrushless file and ran it. I couldn't tell if anything happened. Should there be any message on the console screen?
> > >
> > > I compared this new Homing file to other similar files and am wondering about the program line (43 in Notepad++) "Write3PH(ch4,0,0); // turn off the coil" should that be ch0?
> > >
> > > Anyway I ran the file and tried a move command on the Step Response screen and there was motion which ended with the servo twitching back and forth until disabling it. I changed line 43 to ch0 and ran it again and the plots on Step Response looked much more sensible.
> > >
> > > I know there is tuning to do, but does this HomeBrushless file get ultimately added to the init file?
> > >
> > > Thanks,
> > > David.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi David,
> > > >
> > > > That looks good.ÃâàNote the counts per cycle is not exact as it depends on how the motor moves which is dependent on friction and so forth, but clearly it should be 2 cycles per rev or 5000 counts/cycle.ÃâàSo the relevant information to be extracted from all that is:
> > > >
> > > > invDistPerCycle=0.0002;
> > > > Commutationoffset=2987;
> > > >
> > > >
> > > > Simply putting those two number into the relevant axis configuration and zeroing the encoder at the index mark should allow the motor to commutate (generate torque) properly at any shaft angle.
> > > >
> > > > There are "HomeBrushless" examples that will do this and enable a servo loop.ÃâàSo the next step is to try that and see if you can get the motor to servo (hold position).
> > > >
> > > > I think I have made the appropriate changes in the attached file.
> > > >
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: daveymahomh600e <david.m.stevenson@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, November 8, 2012 5:56 PM
> > > > Subject: [DynoMotion] Re: Step by Step
> > > >
> > > >
> > > > ÃâÃÂ
> > > > Hi Tom,
> > > >
> > > > The new program seems to have cured that issue. Here are 3 reports...
> > > >
> > > > REPORT
> > > > ------
> > > > 0 Position = 1 PhaseAngle = 0.390600
> > > > 1 Position = 10001 PhaseAngle = 2.396800
> > > > 2 Position = 10002 PhaseAngle = 2.299000
> > > > 3 Position = 2 PhaseAngle = 0.255400
> > > > Counts per rev = 10000
> > > > Counts per cycle = 4985
> > > > Counts per cycle (rounded)= 4980
> > > > invDistPerCycle (rounded)= 0.000200803213
> > > > Commutation offset = 2978
> > > > Input Gain Specified = 1.000
> > > >
> > > > REPORT
> > > > ------
> > > > 0 Position = -1 PhaseAngle = 0.390400
> > > > 1 Position = 9999 PhaseAngle = 2.397600
> > > > 2 Position = 10000 PhaseAngle = 2.298800
> > > > 3 Position = 0 PhaseAngle = 0.255000
> > > > Counts per rev = 10000
> > > > Counts per cycle = 4982
> > > > Counts per cycle (rounded)= 4980
> > > > invDistPerCycle (rounded)= 0.000200803213
> > > > Commutation offset = 2979
> > > > Input Gain Specified = 1.000
> > > >
> > > > REPORT
> > > > ------
> > > > 0 Position = -1 PhaseAngle = 0.390500
> > > > 1 Position = 9999 PhaseAngle = 2.397300
> > > > 2 Position = 10000 PhaseAngle = 2.298900
> > > > 3 Position = 0 PhaseAngle = 0.255100
> > > > Counts per rev = 10000
> > > > Counts per cycle = 4983
> > > > Counts per cycle (rounded)= 4980
> > > > invDistPerCycle (rounded)= 0.000200803213
> > > > Commutation offset = 2979
> > > > Input Gain Specified = 1.000
> > > >
> > > > In each case, the motor shaft rotated once in each direction.
> > > >
> > > > Sooo, the next step is....
> > > >
> > > > Thank you very much,
> > > > David.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > >
> > > > >
> > > > > Hi David,
> > > > >
> > > > > It looks like the Index is not being detected every time.ÃÆ'ââ¬Å¡ÃâàBecause the Counts/Rev are always exactly a multiple of 10,000 it appears the encoder and index are working perfectly when it is detected.ÃÆ'ââ¬Å¡ÃâàIt just isn't detected every time.
> > > > >
> > > > > You might check the wire and voltages.ÃÆ'ââ¬Å¡ÃâàIf one of the + or - signals is not connected the signal can be erratic.ÃÆ'ââ¬Å¡ÃâàNormally the index is not present so the + signal will be high (>3V) and the - signal low (< 0.4V). So you might check those voltages with a volt meter.
> > > > >
> > > > > It might be that the pulse is so short that the software loop misses it.ÃÆ'ââ¬Å¡ÃâàYour encoder is fairly high resolution so the index pulse might be very small.ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > >
> > > > >
> > > > > Now that I look at the AutoPhaseFind.c program I see that is actually only checking for the index every millisecond.ÃÆ'ââ¬Å¡ÃâàI've attached a modified program that checks every time slice (180us) which is 5X faster.ÃÆ'ââ¬Å¡ÃâàI've also slowed down the rotation speed about 2X.ÃÆ'ââ¬Å¡ÃâàPlease try that.
> > > > >
> > > > > Regards
> > > > > TK
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: David Stevenson <david.m.stevenson@>
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, November 8, 2012 4:24 PM
> > > > > Subject: RE: [DynoMotion] Re: Step by Step
> > > > >
> > > > >
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > ÃÆ'ïÃâûÃâÿ
> > > > > Hi
> > > > > Tom,
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Here are 4
> > > > > reports, which look a lot better than most have...
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > After each
> > > > > report I noted how many turns (revs) the shaft made... so many in one direction
> > > > > and then so many in the opposite direction. I didn't catch the number for the
> > > > > first set on the first test. I know the encoder is a 2500 ppr, so I expect 10000
> > > > > for a full turn of the shaft.
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > REPORT
> > > > > ------
> > > > > 0 Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà0
> > > > > PhaseAngle = 0.416000
> > > > > 1 Position =ÃÆ'ââ¬Å¡Ãâà10000 PhaseAngle = 2.455000
> > > > > 2
> > > > > Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà1 PhaseAngle = 0.197000
> > > > > 3 Position =
> > > > > -109999 PhaseAngle = -21.803000
> > > > > Counts per rev =ÃÆ'ââ¬Å¡Ãâà10000
> > > > > Counts per
> > > > > cycle =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà4904
> > > > > Counts per cycle (rounded)=ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > 4900
> > > > > invDistPerCycle (rounded)=ÃÆ'ââ¬Å¡Ãâà0.000204081633
> > > > > Commutation offset
> > > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà2822
> > > > > Input Gain Specified =ÃÆ'ââ¬Å¡Ãâà1.000
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > ? and 10
> > > > > turns
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > REPORT
> > > > > ------
> > > > > 0 Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà-1
> > > > > PhaseAngle = 0.417000
> > > > > 1 Position = 119999 PhaseAngle = 24.455000
> > > > > 2
> > > > > Position =ÃÆ'ââ¬Å¡Ãâà39998 PhaseAngle = 8.196000
> > > > > 3 Position =ÃÆ'ââ¬Å¡Ãâà19998
> > > > > PhaseAngle = 4.196000
> > > > > Counts per rev = 120000
> > > > > Counts per cycle
> > > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà4992
> > > > > Counts per cycle (rounded)=ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > 4990
> > > > > invDistPerCycle (rounded)=ÃÆ'ââ¬Å¡Ãâà0.000200400802
> > > > > Commutation offset
> > > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà2872
> > > > > Input Gain Specified =ÃÆ'ââ¬Å¡Ãâà1.000
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > 12 and 10
> > > > > turns
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > REPORT
> > > > > ------
> > > > > 0 Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà2
> > > > > PhaseAngle = 0.417000
> > > > > 1 Position =ÃÆ'ââ¬Å¡Ãâà60001 PhaseAngle = 12.454000
> > > > > 2
> > > > > Position =ÃÆ'ââ¬Å¡Ãâà50001 PhaseAngle = 10.198000
> > > > > 3 Position =ÃÆ'ââ¬Å¡Ãâà30002
> > > > > PhaseAngle = 6.198000
> > > > > Counts per rev =ÃÆ'ââ¬Å¡Ãâà59999
> > > > > Counts per cycle
> > > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà4985
> > > > > Counts per cycle (rounded)=ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > 4980
> > > > > invDistPerCycle (rounded)=ÃÆ'ââ¬Å¡Ãâà0.000200803213
> > > > > Commutation offset
> > > > > =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà2868
> > > > > Input Gain Specified =ÃÆ'ââ¬Å¡Ãâà1.000
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > 6 and 10
> > > > > turns
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > REPORT
> > > > > ------
> > > > > 0 Position =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà0
> > > > > PhaseAngle = 0.417000
> > > > > 1 Position =ÃÆ'ââ¬Å¡Ãâà39999 PhaseAngle = 8.454000
> > > > > 2
> > > > > Position = -40001 PhaseAngle = -7.802000
> > > > > 3 Position = -60002 PhaseAngle =
> > > > > -11.802000
> > > > > Counts per rev =ÃÆ'ââ¬Å¡Ãâà39999
> > > > > Counts per cycle =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > 4977
> > > > > Counts per cycle (rounded)=ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà4980
> > > > > invDistPerCycle
> > > > > (rounded)=ÃÆ'ââ¬Å¡Ãâà0.000200803213
> > > > > Commutation offset =ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > 2868
> > > > > Input Gain Specified =ÃÆ'ââ¬Å¡Ãâà1.000
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > 4 and 10
> > > > > turns
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Here are
> > > > > the settings I used for the APF.c program...
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > #define
> > > > > PWM_CHAN 8ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// which pair of PWM channels used
> > > > > #define
> > > > > ENCODER_CHANÃÆ'ââ¬Å¡Ãâà8ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// which encoder we are connected to
> > > > > #define
> > > > > ENCODER_GAIN 1 ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// Set to -1 if desired to reverse axis
> > > > > direction
> > > > > #define AMPLITUDE 10ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// Set how hard to
> > > > > drive the coils pwm counts
> > > > > #define Z_BIT_NUMBER 66ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// What bit the
> > > > > Z index is connected to
> > > > > #define CLAMP_VOLTAGE 85ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// volts - set a
> > > > > few volts higher than your supply
> > > > > #define
> > > > > AXIS_CHANÃÆ'ââ¬Å¡Ãâà0ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// Axis channel
> > > > > to be used and configured
> > > > > #define Ncycles 4ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// don't change
> > > > > this
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Thank
> > > > > you,
> > > > > David.
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > >
Group: DynoMotion |
Message: 6025 |
From: Tom Kerekes |
Date: 11/10/2012 |
Subject: Re: Step by Step |
Hi David, Excellent. That looks quite good for a start. The next step is tuning which involves: PID tuning, adding a low pass filter, increasing max output, finding your max Velocity, Acceleration, and Jerk, Reducing Max Following error to fault on any problem. Please read those threads on tuning and let us know how much makes sense. Of course the goal is to move at the speeds and velocities needed with your required accuracy. Note in your current plots the max following error is about 160 encoder counts. You should convert this to real distance to understand if this is acceptable. Also note that only ~16 output counts and ~ 1Amp is used by the motor so you have the potential of much higher acceleration. Test longer "size" moves to get to higher
velocities. HTH Regards TK
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |